package linwen.wang.order.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

@Configuration
public class RestTemplateConfig {

    @Bean
    public RestTemplate restTemplate(){
        // return new RestTemplate();// /默认就是SimpleClientHttpRequestFactory  底层采用jdk的UrlConnection
        // return new RestTemplate(new HttpComponentsClientHttpRequestFactory());// Apache的HttpClient
        return new RestTemplate(new OkHttp3ClientHttpRequestFactory());

    }
}
